import axios from "axios";
import storageUtils from "../utils/storageUtils.ts"
const querystring = require('querystring');


const Authentication = storageUtils.getStorage("token")

//获取商品类型
export const getAllGoodType = (params) => axios({
    url:"http://xawn.f3322.net:8012/gen/goodstype",
    headers:{
        Authentication
    },
    params
})

//添加商品类型
export const addOneGoodType = (data) => axios({
    url:"http://xawn.f3322.net:8012/gen/goodstype",
    method:'POST',
    headers:{
        Authentication
    },
    data:querystring.stringify(data)
})

//删除商品类型
export const delManyGoodType = (data) => axios({
    url:"http://xawn.f3322.net:8012/gen/goodstype/"+data,
    method:'DELETE',
    headers:{
        Authentication
    },
})


















//获取服务类别
export const getAllServe = (params) => axios({
    url:"http://xawn.f3322.net:8012/gen/servicetype",
    headers:{
        Authentication
    },
    params
})

//添加服务类型
export const addServeType = (data) => axios({
    url:"http://xawn.f3322.net:8012/gen/servicetype",
    method:'POST',
    headers:{
        Authentication
    },
    data:querystring.stringify(data)
})

//修改服务类型
export const changeOneServeType = (data) => axios({
    url:"http://xawn.f3322.net:8012/gen/servicetype",
    method:'PUT',
    headers:{
        Authentication
    },
    data:querystring.stringify(data)
})

//删除服务类型
export const delManyServeType = (data) => axios({
    url:"http://xawn.f3322.net:8012/gen/servicetype/"+data,
    method:'DELETE',
    headers:{
        Authentication
    },
})